package com.es.service.impl;


import com.es.entity.Student;
import com.es.mapper.StudentMapper;
import com.es.service.StudentService;

import java.util.List;

public class StudentServiceImpl implements StudentService {

    private StudentMapper mapper;

    @Override
    public int save(Student student) {
        int i = mapper.save(student);
        int j = 10/0;// 异常
        return i;
    }

    @Override
    public int update(Student student) {
        return mapper.update(student);
    }

    @Override
    public int delete(Integer id) {
        return mapper.delete(id);
    }

    @Override
    public List<Student> list() {
        return mapper.list();
    }

    @Override
    public Student get(Integer id) {
        return mapper.get(id);
    }

    public StudentMapper getMapper() {
        return mapper;
    }

    public void setMapper(StudentMapper mapper) {
        this.mapper = mapper;
    }
}
